<?php

class Content_Form_Admin_Post_Add extends Nuo_Form
{

	public function init()
	{
		$this -> setTitle('add post');

		$this -> setDescription('content.form.admin.post.create.desc');

		$this -> addElement('text', 'post_title', array(
				'label' => 'title',
				'description' => 'content.form.admin.post.create.title.desc',
				'required' => 1,
				'class' => 'text long-text'
		));

		$this -> addElement('text', 'post_tags', array(
				'label' => 'tags',
				'description' => 'content.form.admin.post.create.tags.desc',
				'required' => 0,
				'class' => 'text long-text'
		));

		$this -> addElement('textarea', 'post_summary', array(
				'label' => 'summary',
				'description' => 'content.form.admin.post.create.summary.desc',
				'required' => 0,
				'class' => 'basic'
		));

		$this -> addElement('textarea', 'post_content', array(
				'label' => 'content',
				'description' => 'content.form.admin.post.create.content.desc',
				'required' => 1,
				'class' => 'text long-text'
		));
		
		
		
		$subForm = new Nuo_Form_SubForm;
		
		$subForm->addElement('checkbox','menu_enabled',array(
			'label'=>'provide a menu link',
		));
		
		$subForm->addElement('checkbox','revision_enabled',array(
			'label'=>'create a new revision',
		));
		
		$subForm -> addElement('text', 'post_alias', array(
				'label' => 'url alias',
				'description' => 'content.form.admin.post.create.alias.desc',
				'required' => 0,
				'class' => 'text long-text'
		));
		
		$subForm->addDisplayGroup(array('menu_enabled'), '_menu',array(
			'label'=>'menu settings',
			'description'=>'menu settings',
		));
		
		$subForm->addDisplayGroup(array('revision_enabled'), '_revision',array(
			'label'=>'revision settings',
			'description'=>'revision settings',
		));
		
		$subForm->addDisplayGroup(array('post_alias'), '_alias',array(
			'label'=>'alias settings',
			'description'=>'alias settings',
		));
		
		$this->addSubForm($subForm, 'tab1');

		$this -> addElement('button', '_submit', array(
				'label' => 'submit',
				'type' => 'submit',
				'class' => 'submit',
				'decorators' => array('ViewHelper'),
		));

		$this -> addElement('button', '_con', array(
				'label' => 'save & continue',
				'type' => 'submit',
				'class' => 'submit',
				'decorators' => array('ViewHelper'),
		));

		$this -> addElement('button', '_cancel', array(
				'label' => 'cancel',
				'type' => 'cancel',
				'class' => 'cancel',
				'onclick'=>'window.history.go(-1)',
				'decorators' => array('ViewHelper'),
		));

		$this -> addDisplayGroup(array(
				'_submit',
				'_con',
				'_cancel'
		), '_buttons');
	}

}
